/*
* @author dumeng
*/
'use strict'
import request from '@/utils/request'
/**
 * 异步企业部门树
 */
export function getComAndOrgTree(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/departmentInfo/getDeptTree',
    method: 'post',
    data
  })
}

/**
 * 字典
 */
export function getDictByCode(dictCode) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/sysDictionary/getDictByCode',
    method: 'POST',
    data: { dictCode }
  })
}

export function queryPage(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/worksUpload/queryPage',
    method: 'post',
    data
  })
}

/**
 *已审核作品列表
 * @param data
 * @returns {*}
 */
export function queryAuditedPage(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/worksShow/queryPage',
    method: 'post',
    data
  })
}

export function get(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/worksUpload/get',
    method: 'post',
    data
  })
}

export function insert(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/worksUpload/insert',
    method: 'post',
    data
  })
}

export function update(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/worksUpload/update',
    method: 'post',
    data
  })
}

/**
 * 作品 上架 下架
 * @param data
 * @returns {*}
 */
export function updateState(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/worksShow/updateIsOff',
    method: 'post',
    data
  })
}

/**
 * 设置推荐
 * @param data
 * @returns {*}
 */
export function recommend(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/worksShow/updateIsRecommend',
    method: 'post',
    data
  })
}
/**
 * 驳回
 * @param data
 * @returns {*}
 */
export function reject(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/worksUpload/audit',
    method: 'post',
    data
  })
}

export function del(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/questionnaireSurvey/deleteById',
    method: 'post',
    data
  })
}

/**
 * 审核作品
 * @param data
 * @returns {*}
 */
export function audit(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/worksUpload/audit',
    method: 'post',
    data
  })
}

/**
 * 评论列表-审核页面
 */
export function queryPage4comment(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/activityComment/queryPageRoot',
    method: 'post',
    data
  })
}

/**
 * 评论列表-查看更多-审核页面
 * @param data
 * @returns {*}
 */
export function queryPage4commentSon(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/activityComment/queryPageSon',
    method: 'post',
    data
  })
}
/**
 * 评论列表-查看评论
 */
export function queryCommentList(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/worksShow/queryPageComment',
    method: 'post',
    data
  })
}
/**
 * 修改评论状态-查看评论页面
 */
export function update4comment(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/worksShow/updateCommentStatus',
    method: 'post',
    data
  })
}
/**
 * 查看评论祖先-查看评论页面
 */
export function queryPage4commentParent(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/worksShow/queryPageCommentParent',
    method: 'post',
    data
  })
}
/**
 *
 * @param data
 * @returns {*}
 */
export function getActivityDetail(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/solicitationInfo/get',
    method: 'post',
    data
  })
}

/**
 * 单独设置作品-评分状态
 */
export function setWorksEvaluateState(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/worksShow/updateEvaluateState',
    method: 'post',
    data
  })
}

/**
 * 单独设置作品-点赞状态
 */
export function setWorksFavorState(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/worksShow/updateFavorState',
    method: 'post',
    data
  })
}

/**
 * 单独设置作品-评论状态
 */
export function setWorksCommentState(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/worksShow/updateCommentState',
    method: 'post',
    data
  })
}
/**
 * 获取推荐最大排序号
 */
export function getMaxSort(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/worksShow/getMaxRecommendSort',
    method: 'post',
    data
  })
}

